<?php if ($cat_id > 0) { ?>
	<table border="0" style="width:100%;" cellpadding="0" cellspacing="0">
		<colgroup>
			<col width="50px" />
			<col width="30px" />
			<col width="30px" />
			<col />
		</colgroup>
		<tr>
			<td class="grid_header">Id</td>
			<td class="grid_header" colspan="2">&nbsp;</td>
			<td class="grid_header">Name</td>
		</tr>
		<?php $cnt = 0;
		foreach ($doc_list as $document) {
			$css_class = '';
			if (intval($info['id']) == intval($document['id'])) {
				$css_class = ' grid_cell_highlight';
			} ?>
			<tr>
				<td class="grid_cell<?php echo $css_class; ?>"><?php echo $document['id']; ?></td>
				<td class="grid_cell<?php echo $css_class; ?>"">
				<?php if ($cnt > 0) { ?>
					<a href="<?php echo BASE_URL; ?>document/sequence/<?php echo $document['id']; ?>/<?php echo $cat_id; ?>/1" class="grid_link">
						<img src="<?php echo PUBLIC_URL; ?>images/sequence_up.png" style="display:block; border:none;" alt="Up" title="Up" />
					</a>
				<?php } else { ?>
					&nbsp;
				<?php } ?>
				</td>
				<td class="grid_cell<?php echo $css_class; ?>"">
				<?php if ((count($doc_list) - 1) > $cnt) { ?>
					<a href="<?php echo BASE_URL; ?>document/sequence/<?php echo $document['id']; ?>/<?php echo $cat_id; ?>/2" class="grid_link">
						<img src="<?php echo PUBLIC_URL; ?>images/sequence_down.png" style="display:block; border:none;" alt="Down" title="Down" />
					</a>
				<?php } else { ?>
					&nbsp;
				<?php } ?>
				</td>
				<td class="grid_cell<?php echo $css_class; ?>"">
					<a href="<?php echo BASE_URL; ?>document/update/<?php echo $document['id']; ?>" class="grid_link">
						<?php echo $document['name']; ?>
					</a>
				</td>
			</tr>
			<?php
			$cnt++;
		} ?>
	</table>
<?php } else if (count($cat_list) > 0) { ?>
	<table border="0" style="width:100%;" cellpadding="0" cellspacing="0">
		<colgroup>
			<col width="50px" />
			<col />
		</colgroup>
		<tr>
			<td class="grid_header">Id</td>
			<td class="grid_header">Document found in next categories</td>
		</tr>
		<?php
		foreach ($cat_list as $category) { ?>
			<tr>
				<td class="grid_cell"><?php echo $category['id']; ?></td>
				<td class="grid_cell">
					<a href="<?php echo BASE_URL; ?>document/sequence/<?php echo $doc_id; ?>/<?php echo $category['id']; ?>" class="grid_link">
						<?php echo $category['path']; ?>
					</a>
				</td>
			</tr>
		<?php } ?>
	</table>
<?php } else { ?>
	No categories found
<?php } ?>